home *** CD-ROM | disk | FTP | other *** search
- Path: hypatia.pec.co.nz!JohnM
- From: JohnM@hypatia.pec.co.nz (John Marshall)
- Newsgroups: comp.lang.c++
- Subject: Re: Coding Standards
- Date: 24 Mar 1996 21:59:54 GMT
- Organization: PEC (NZ) Ltd.
- Message-ID: <4j4gkq$j6c@janus.pec.co.nz>
- References: <4hj8ek$elu@sam.inforamp.net> <4hktar$5o2@galaxy.ucr.edu> <4hmqol$97j@abacus.abasoft.co.uk> <4hsg8r$pmm@sam.inforamp.net> <4i9o6j$p4l@daisy.pgh.wec.com> <4idskb$pc1@sam.inforamp.net> <314EBD08.43BC@virtus.com> <4io2i7$n9v@sam.inforamp.net> <4isu2t$opo@jan <4j2jot$svj@sam.inforamp.net>
- Reply-To: johnm@pec.co.nz
- NNTP-Posting-Host: hypatia.pec.co.nz
- X-Newsreader: TIN [version 1.2 PL2]
-
- Randy Charles Morin (rmorin@inforamp.net) wrote:
- > your post compilation objects are not encapsulated and don't use data hiding.
- > That means, that if your object data member's changes types, then you have to
- > make an effort to conform other objects to your changes.
-
- Huh? My post-compilation objects are monolithic applications, and if my
- data types change, they don't know about it until I make the effort to
- type "make" to make a new version.
-
- > Imagine you are a producing a commercial system for several large
- > corporations. The large corporation use your hooks (sometimes inline
- > accessors) to add functionality that is dependant on their particular
- > business needs.
-
- Oh, so I'm writing a *library*. And it's shipped to users separately from
- the applications that use it. Why didn't you say so?
-
- > If you don't have
- > inline accessors, then you don't have a problem. Is this so hard to
- > understand?
-
- Well, yes, as usual it is hard to understand, simply because it's not true.
- Inline accessors are only one of the things you have to worry about.
-
- For example, if you have classes that the clients can construct themselves,
- rather than being limited to getting pointers to them manufactured by your
- library, then you can't change their layout or size. (Many window systems,
- such as Amiga and Macintosh, have structs like this.) So you have to
- define your public structs with room for expansion from the start.
-
- For example, depending on your DLL technology, you may have to be very
- careful about rearranging or adding to the list of externally visible
- functions, for fear of changing entry point offsets.
-
- On the other hand, if one *is* writing a monolithic application, then inline
- accessors are no more harmful than anything else.
-
- It seems to me that what developers need is knowledge of all these
- implications, rather than just blind adherence to some incomplete rule
- like "NEVER use the word inline".
-
- John.
-